#!/user/bin/env python3
#! -*- coding: utf-8 -*-
__author__ ="jzp";

import re;

'''
python练习
'''

# ======== 数据类型 ========
# s = input();
# print(s);

# ======== 数据类型 ========#
a = 231;
print("a的值是 %d,其类型是 %s"%(a,type(a)))
a = 231.442;
print("a的值是 %f,其类型是 %s"%(a,type(a)))
a = True;
print("a的值是 %s,其类型是 %s"%(a,type(a)))
a = 4 + 2j;
print("a的值是 %s,其类型是 %s"%(a,type(a)))
a = "asdasfasfsa";
print("a的值是 %s,其类型是 %s"%(a,type(a)))
a = ["asda",True,None,12,23.32,12];
print("a的值是 %s,其类型是 %s"%(a,type(a)))
a = ("asda",True,None,12,23.32,12);
print("a的值是 %s,其类型是 %s"%(a,type(a)))
a = {"name":"jzp","age":21};
print("a的值是 %s,其类型是 %s"%(a,type(a)))
a = {"name","jzp","age","age"};
print("a的值是 %s,其类型是 %s"%(a,type(a)))
a = None;
print("a的值是 %s,其类型是 %s"%(a,type(a)))


# ======== 运算符========
print((34 + 22.33) / 5);
print(5 % 2);
print(5 // 2);
print(True and True);
print(True or False);
print(not False);


# ==========ASCⅡ=========
print(ord("a"));
print(chr(98));


# ==========encode && encode=====
print("cdsac".encode("ASCII"));
print("中文".encode("utf-8"));
print(b'cdsac'.decode("ASCII"));


# =============string=========
print("Hi %s 你好" % "jzp");
# *同学你好，在*学期，你的成绩是*，提升了*%
print("%s同学你好，在%02d学期，你的成绩是%.2f,提升了%.2f%%" %("jzp",2,99.51,114.514))
print(len("cdasca"));
print(len("中文"));
print(len("中文".encode("utf-8")));
print("usvb".find("v"));



# ===========正则表达式=========
print(re.match("j","ajzp"));#搜第一个字母
print(re.search("j","jzp"));#搜全文
#截至5.9，新冠234例，海外77，治愈456，死亡4，住院观察56
pa = "截至5.9，新冠(\d+)例，海外(\d+)，治愈(\d+)，死亡(\d+)，住院观察(\d+)";









